package com.corticon.dialogs.dto;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import com.corticon.dialogs.model.ResponseEntry;
import com.corticon.dialogs.util.QuestionUtils;

/**
 * @author Lifan Yang
 * @since 2008-11-18
 */
public class PreviewQuestionDTO implements Serializable, Comparable {

    private String sequence;
    private String text;
    private String responseType;
    private String uiType;
    private Double priority;
    private String width;
    private List<ResponseEntry> responses = new ArrayList<ResponseEntry>();

    public PreviewQuestionDTO() {
    }

    public String getSequence() {
        return sequence;
    }

    public void setSequence(String sequence) {
        this.sequence = sequence;
    }

    public String getText() {
        return text;
    }

    public void setText(String title) {
        this.text = title;
    }

    public String getResponseType() {
        return responseType;
    }

    public void setResponseType(String responseType) {
        this.responseType = responseType;
    }

    public String getUiType() {
        return uiType;
    }

    public void setUiType(String uiType) {
        this.uiType = uiType;
    }

    public Double getPriority() {
        return priority;
    }

    public void setPriority(Double priority) {
        this.priority = priority;
    }

    public List<ResponseEntry> getResponses() {
        return responses;
    }

    public void setResponses(List<ResponseEntry> responses) {
        this.responses = responses;
    }

    public String getWidth() {
        return width;
    }

    public void setWidth(String width) {
        this.width = width;
    }

    public int compareTo(Object o) {
        return QuestionUtils.compareSequence(this.getSequence(), ((PreviewQuestionDTO) o).getSequence());
    }
}
